﻿//  Copyright (c) 2011 Ray Liang (http://www.dotnetage.com)
//  Licensed MIT: http://www.opensource.org/licenses/mit-license.php

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;

namespace DNA.Mvc.Community.Events
{
    public class DeletePostEvent : EventBase
    {
        public DeletePostEvent(Post post)
        {
            if ((post != null) && (post.ID > 0) && post.IsApproved)
            {
                Post = post; 
                
                if (post.IsThread)
                    this.Name = "DeleteThread";
                else
                    this.Name = "DeletePost";
            }
        }

        public Post Post { get; private set; }

        public override void Raise()
        {
            if ((Post != null) && (Post.ID > 0))
            {
                base.Raise();
            }
        }

    }
}
